'use strict';

const { Service } = require('egg');
class ProHelpService extends Service {
  // 添加帮助信息
  async createNeedHelp (info) {
    const { ctx, app } = this;
    try {
      const result = await app.mysql.insert('provideDrug', info); // 给list表新增一条数据
      return result;
    } catch (error) {
      console.log(error);
      return null;
    }
  }
  // 编辑帮助信息
  async editProHelp (id, isSolve) {
    const { ctx, app } = this;
    try {
      const result = await app.mysql.update('provideDrug', { isSolve }, {
        where: {
          id
        }
      });
      return result;
    } catch (error) {
      console.log(error);
      return null;
    }
  }
}
module.exports = ProHelpService;
